const axios = require('axios')
const jsdom = require('jsdom')

async function start() {

    let ret = []

    let count = 5

    for(let i = 0 ; i < count ; i++) {
        let response = await axios.get(`https://movie.douban.com/j/search_subjects`, {
            params: {
                type: 'movie',
                tag: '豆瓣高分',
                sort: 'rank',
                page_limit: 20,
                page_start: i * 20
            }
        })
        response.data.subjects.forEach(v => {
            ret.push({
                title: v.title,
                rate: v.rate
            })
        })
    }

    console.table(ret)
}

start()